<?php /* Smarty version 2.6.20, created on 2017-05-20 19:39:03
         compiled from product_consult.htm */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'product_consult.htm', 159, false),array('modifier', 'count', 'product_consult.htm', 263, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>产品咨询</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
</head>
<body>
<div class="container">
    <div class="flow">
        <div class="itemtitle">
            <h3>产品咨询</h3>
            <ul>
                <li <?php if ($_GET['operation'] == ''): ?>class="current"<?php endif; ?>><a href="?m=product&s=product_consult.php"><span>全部咨询</span></a></li>
                 
                 <li <?php if ($_GET['operation'] == 'cat'): ?>class="current"<?php endif; ?>><a href="?m=product&s=product_consult.php&operation=cat"><span>咨询分类</span></a></li>
                <?php if ($_GET['operation'] == 'edit' && $_GET['editid']): ?>
				<li class="current"><a href="#"><span>咨询回答</span></a></li>
                <?php endif; ?>
                <?php if ($_GET['operation'] == 'cat_edit' && $_GET['editid']): ?>
				<li class="current"><a href="#"><span>分类修改</span></a></li>
                <?php endif; ?>
                <?php if ($_GET['operation'] == 'cat_edit' && ! $_GET['editid']): ?>
				<li class="current"><a href="#"><span>新增分类</span></a></li>
                <?php endif; ?>
            </ul>
        </div>
    </div>
	<div class="h35"></div>  
    <?php if ($_GET['operation'] == 'cat'): ?>
    <form action="" method="post">
    <table class="table">
        <tbody>
            <tr class="header partition">
                <th width="30"></th>
                <th>分类名</th>
                <th width="50"></th>
            </tr>
            <?php $_from = $this->_tpl_vars['de']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
            <tr>
                <td><input type="checkbox" value="<?php echo $this->_tpl_vars['list']['id']; ?>
" class="checkitem" name="chk[]"></td>
                <td><input type="text" class="w350" name="name[<?php echo $this->_tpl_vars['list']['id']; ?>
]" value="<?php echo $this->_tpl_vars['list']['name']; ?>
" /></td>
                <td>
                <a href="?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
&operation=cat_edit&editid=<?php echo $this->_tpl_vars['list']['id']; ?>
"><?php echo $this->_tpl_vars['editimg']; ?>
</a>
                <a onclick="return confirm('确定删除吗');" href="?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
&operation=cat&delid=<?php echo $this->_tpl_vars['list']['id']; ?>
"><?php echo $this->_tpl_vars['delimg']; ?>
</a>
                </td>
            </tr>
            <?php endforeach; else: ?>
            <tr>
                <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
            </tr>
            <?php endif; unset($_from); ?>
        </tbody>
        <tbody>
            <tr>
                <td></td>
                <td colspan="99"><div><a class="addtr" href="?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
&operation=cat_edit">添加新服务</a></div></td>
            </tr>
        </tbody>
        <tfoot>
            <tr>
                <td colspan="99">
                    <input type="checkbox" class="checkall" id="del">
                    <input type="hidden" name="act" value="op" />
                    <input type="submit" name="submit" value="<?php echo $this->_tpl_vars['lang']['btn_submit']; ?>
" />
                </td>
            </tr>
        </tfoot>
    </table>
    </form>
    <?php elseif ($_GET['operation'] == 'cat_edit'): ?>
    <table class="table">
        <tbody>
        <tr>
            <th colspan="99" class="partition">提示</th>
        </tr>
        <tr>
            <td>
                <ul class="tips">
                    <li>当分类为帮助时，内容为展示内容。</li>
                    <li>当分类为常规时，内容为提示内容。</li>
                </ul>
            </td>
        </tr>
        </tbody>
    </table>
    <form name="form" id="form" method="post">
    <input name="id" type="hidden" id="id" value="<?php echo $this->_tpl_vars['de']['id']; ?>
">
    <table class="table">
        <thead>
            <tr>
                <th class="partition" colspan="99">产品咨询</th>
            </tr>
        </thead>
        <tbody>
        <tr>
            <td>分类名</td>
            <td>
            <input name="name" type="text" id="name" class="w350" value="<?php echo $this->_tpl_vars['de']['name']; ?>
"/>
            <div id="form-error" class="form-error"></div>
            </td>
        </tr>
        
        <tr>
            <td>是否为帮助</td>
            <td>
            <input type="checkbox" value="1" id="type" name="type"  <?php if ($this->_tpl_vars['de']['type']): ?> checked="checked" <?php endif; ?> >
            </td>
        </tr>
        
        <tr>
            <td>内容</td>
            <td>
			<script charset="utf-8" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/lib/kindeditor/kindeditor-min.js"></script>
            <script>
                var editor;
                KindEditor.ready(function(K) {
                    editor = K.create('textarea[name="con"]', {
                });
            });
            </script>
        	<textarea name="con" id="con" style="width:90%; height:280px;"><?php echo $this->_tpl_vars['de']['con']; ?>
</textarea>
            </td>
        </tr>
       
        
        <tr>
            <td>&nbsp;</td>
            <td>
            <input class="submit" type="submit" value="提交">
            <input name="act" type="hidden" id="action" value="<?php if (! $_GET['editid']): ?>save<?php else: ?>edit<?php endif; ?>">
           
            </td>
        </tr>
        </tbody>
    </table>
    </form>
    <?php elseif ($_GET['operation'] == 'edit'): ?>
    <form name="form" id="form" method="post">
    <input name="id" type="hidden" id="id" value="<?php echo $this->_tpl_vars['de']['id']; ?>
">
    <table class="table">
        <thead>
            <tr>
                <th class="partition" colspan="99">咨询</th>
            </tr>
        </thead>
        <tbody>
        <tr>
            <td>产品名称</td>
            <td><a target="_blank" href="../?m=product&s=detail&id=<?php echo $this->_tpl_vars['de']['product_id']; ?>
"><?php echo $this->_tpl_vars['de']['product_name']; ?>
</a></td>
        </tr>
        <tr>
            <td>提问者</td>
            <td><a target="_blank" href="../?m=product&s=detail&id=<?php echo $this->_tpl_vars['de']['member_id']; ?>
"><?php echo $this->_tpl_vars['de']['member_name']; ?>
</a></td>
        </tr>
        <tr>
            <td>咨询内容</td>
            <td><?php echo $this->_tpl_vars['de']['question']; ?>
<p><?php echo ((is_array($_tmp=$this->_tpl_vars['de']['question_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d&nbsp;%H:%M:%S") : smarty_modifier_date_format($_tmp, "%Y-%m-%d&nbsp;%H:%M:%S")); ?>
</p></td>
        </tr>
        
        <tr>
            <td>网站回复</td>
            <td>
        	<textarea name="answer" id="answer" style="width:90%; height:180px;"><?php echo $this->_tpl_vars['de']['answer']; ?>
</textarea>
            <?php if ($this->_tpl_vars['de']['answer']): ?>
            <p><?php echo ((is_array($_tmp=$this->_tpl_vars['de']['answer_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d&nbsp;%H:%M:%S") : smarty_modifier_date_format($_tmp, "%Y-%m-%d&nbsp;%H:%M:%S")); ?>
</p>
            <?php endif; ?>
            </td>
        </tr>
        <?php if ($this->_tpl_vars['de']['answer']): ?>
        <tr>
            <td>回答者</td>
            <td><?php echo $this->_tpl_vars['de']['answer_name']; ?>
</td>
        </tr>
        <?php endif; ?>
        
        <tr>
            <td>&nbsp;</td>
            <td>
            <input class="submit" type="submit" value="提交">
            <input name="act" type="hidden" id="action" value="<?php if (! $_GET['editid']): ?>save<?php else: ?>edit<?php endif; ?>">
           
            </td>
        </tr>
        </tbody>
    </table>
    </form>
    <?php else: ?>
    <script type="text/javascript">
    $(function(){
        /* 全选 */
         $('.checkall').click(function(){
            var _self = this;
            $('.checkitem').each(function(){
                if (!this.disabled)
                {
                    $(this).attr('checked', _self.checked);
                }
            });
            $('.checkall').attr('checked', this.checked);
        });	 
    });
    </script>
    <form action="" method="get">
    <input type="hidden" name="m" value="product">
    <input type="hidden" name="s" value="product_consult.php">
    <table class="select_table">
        <tbody>
            <tr>
                <td width="70">产品名称:</td>
                <td colspan="2"><input type="text" name="name" class="w250" value="<?php echo $_GET['name']; ?>
" /></td>
            </tr>
            <tr>
                <td width="70">咨询内容:</td>
                <td colspan="2"><input type="text" name="key" class="w250" value="<?php echo $_GET['key']; ?>
" /></td>
            </tr>
            <tr>    
                <td width="70">咨询分类:</td>
                <td colspan="2">
                <select name="catid">
                	<option value="">请选择</option>
                    <?php $_from = $this->_tpl_vars['consultcat']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
                    <option <?php if ($_GET['catid'] == $this->_tpl_vars['list']['id']): ?> selected="selected"<?php endif; ?> value="<?php echo $this->_tpl_vars['list']['id']; ?>
"><?php echo $this->_tpl_vars['list']['name']; ?>
</option>
                    <?php endforeach; endif; unset($_from); ?>
                </select>
                </td>
            </tr>
            <tr>    
                <td width="70">咨询分类:</td>
                <td width="50">
                <select name="status">
                	<option value="">请选择</option>
                    <option <?php if ($_GET['status'] == 1): ?> selected="selected"<?php endif; ?> value="1">未回复</option>
                    <option <?php if ($_GET['status'] == 2): ?> selected="selected"<?php endif; ?> value="2">回复</option>
                </select>
                </td>
                <td><input type="image" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/image/admin/search.gif" /></td>
            </tr>
        </tbody>
    </table>
    </form>
    <form action="" method="post" id="form" name="form">
    <input type="hidden" name="act" value="op" />
    <table class="table product">
        </thead>
        <tbody>
            <tr class="partition">
                <th width="1"></th>
                <th width="20" valign="top"><input type="checkbox" class="checkall" id="del"></th>
                <th class="al" width="*">咨询内容</th>
                <th width="100">提问者</th>
                <th width="60">更新时间</th>
                <th width="70"></th>
            </tr>
            <?php $_from = $this->_tpl_vars['de']['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['item']):
?>
            <tr bgcolor="#EFF8FD">
            	<td colspan="5" class="al pl20">
                <a target="_blank" href="../?m=product&s=detail&id=<?php echo $this->_tpl_vars['item']['id']; ?>
"><?php echo $this->_tpl_vars['item']['pname']; ?>
</a>
                <strong class="red ml10"><?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo $this->_tpl_vars['item']['price']; ?>
</strong>
                <span class="ml10">库存：<?php echo $this->_tpl_vars['item']['stock']; ?>
</span>
                </td>
                <td><a href="?m=product&s=product_consult.php&id=<?php echo $this->_tpl_vars['item']['id']; ?>
"><?php echo count($this->_tpl_vars['item']['consult']); ?>
条记录</a></td>
            </tr>   
            <?php $_from = $this->_tpl_vars['item']['consult']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
            <tr>
                <td></td>
                <td><input type="checkbox" value="<?php echo $this->_tpl_vars['list']['id']; ?>
" class="checkitem" name="chk[]"></td>
                <td class="al"><?php if ($this->_tpl_vars['list']['status'] == 2): ?><?php echo $this->_tpl_vars['list']['question']; ?>
<?php else: ?><span class="red"><?php echo $this->_tpl_vars['list']['question']; ?>
<?php endif; ?></span></td>
               
                <td><?php echo $this->_tpl_vars['list']['member_name']; ?>
</td>
				<td><?php echo ((is_array($_tmp=$this->_tpl_vars['list']['question_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d<br>%H:%M:%S") : smarty_modifier_date_format($_tmp, "%Y-%m-%d<br>%H:%M:%S")); ?>
</td>
                <td>
                <a href="?operation=edit&editid=<?php echo $this->_tpl_vars['list']['id']; ?>
&<?php echo $this->_tpl_vars['url']; ?>
"><?php echo $this->_tpl_vars['editimg']; ?>
</a>
                </td>
            </tr>
            <?php endforeach; endif; unset($_from); ?>
            <?php endforeach; else: ?>
            <tr>
                <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
            </tr>
            <?php endif; unset($_from); ?>
        </tbody>
        <tfoot>
            <tr>
            	<td></td>
            	<td colspan="6">
                <input type="checkbox" class="checkall" id="del">
                <input type="hidden" name="act" value="op" />
				<input type="submit" value="提交" />
                <div class="page"><?php echo $this->_tpl_vars['de']['page']; ?>
</div>
                </td>
            </tr>
        </tfoot>
    </table>
    </form>
    <?php endif; ?>
</div>
</body>
</html>